﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/PollMaster.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<GACFFP.User>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

        <%=ViewData["AdminControlBar"] %>






    <hr />

        <%=ViewData["UserDetail"] %>



    <hr />
    <div class="formWrapper">

        <div class="callout">
        <%= ViewData["PageMessage"] %>
        Current client side cookie is set to: 
        <script language="javascript">
            document.writeln($.cookie("GACFFP_Voter"));
        </script>
    </div>
    <br />
    <table class="cellborder" border="0" cellpadding="0" cellspacing="0" width="100%">

   
        <tr>
            <th>UserName</th>
            <th>Role</th>
            <th># of Votes</th>
            <th>date of most recent vote</th>
            <th>edit user</th>
            <th>edit most recent vote</th>
            <th>set user</th>
        </tr>
  

    <% 
        try
        {
            if (Model.Count() > 0)
            {
                foreach (var user in Model)
                { 
            %>
            <tr>
                <td ><%=user.userName%></td>
                <td><%=user.role %></td>
                <td><%=user.Votes.Count.ToString()%></td>
                <td><% %></td>
                <td><a href="EditUser?u=<%=user.userName%>">edit user</a></td>
                <td>--to do--</td>
                <td><a href="/poll/userdetail?GACFFP_Voter=<%=user.userName%>">set user</a></td>
            </tr>
            <%
                }

            }
        }
        catch(Exception e)
        { %>
             <tr>
                <td><%=e.ToString() %></td>
            </tr>
        <%
        }
           %>
    
    </table>

    <br />



    </div>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
